﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ChargeManagement.BLL
{
    /// <summary>
    /// Strategry pattern's context class
    /// </summary>
    class CashContext
    {
        /// <summary>
        /// maintains a reference to a Strategy object 
        /// </summary>
        private CashBase cs;

        /// <summary>
        /// configured the strategy object with a ConcreteStrategy object 
        /// </summary>
        /// <param name="csuper"></param>
        public void setBehavior(CashBase csuper)
        {
            this.cs = csuper;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="money"></param>
        /// <returns></returns>
        public double GetResult(double money)
        {
            return cs.acceptCash(money);
        }
    }
}
